package com.liangsong.designpattern.command;

public class Bold implements ICommand{
    private final EditText editText;
    private String previousText;
    public Bold(EditText editText){
        this.editText = editText;
    }
    @Override
    public void execute() {
        previousText = editText.getText();
        editText.setText("**"+editText.getText()+"**");
    }

    @Override
    public void undo() {
        editText.setText(previousText);
    }
}
